package cc.buttfu.thingbento;

import java.util.ArrayList;
import android.accounts.NetworkErrorException;

/**
 * @author dislink.now
 * 
 * An interface for loading posts from pages. Page could be the shouts page,
 * forum threads, mailboxes, gallery threads, etc. These will all need different
 * page scraper logic yet all result in pretty much the same thing - an
 * array of "posts". 
 *
 */
public interface PageLoader {

	/**
	 * Sets the page and begins the loading process. Should not be performed
	 * in the UI thread to avoid stalling the UI.
	 * 
	 * @param page The URL page suffix
	 * @throws NotLoggedInException
	 * @throws NetworkErrorException
	 * @throws NagScreenException
	 */
	public void setPage(String page) throws NotLoggedInException, NetworkErrorException, NagScreenException;
	
	public ArrayList<Post> getPosts();
	
	public Post getPost(int index);
	
	public int size();
	
	public boolean finished();
	
}
